package com.sc.nft.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sc.nft.mapper.SaasTaskMeetConditionsMapper;
import com.sc.nft.entity.SaasTaskMeetConditions;
import com.sc.nft.service.SaasTaskMeetConditionsService;
import org.springframework.stereotype.Service;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 任务满足条件表(SaasTaskMeetConditions)表Dao层
 *
 * @author 王伟成
 * @since 2024-01-11 15:09:02
 */
@Slf4j
@Repository
public class SaasTaskMeetConditionsDao extends ServiceImpl<SaasTaskMeetConditionsMapper, SaasTaskMeetConditions> {

    public SaasTaskMeetConditions getByTaskId(Long taskId) {
        return this.lambdaQuery().eq(SaasTaskMeetConditions::getSaasTaskId, taskId).one();
    }
    public void deleteBySaasTaskId(Long taskId) {
        LambdaQueryWrapper<SaasTaskMeetConditions> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(SaasTaskMeetConditions::getSaasTaskId, taskId);
        this.remove(wrapper);
    }
}
